package com.zhiying.web.config;

import com.zhiying.shiro.PermissionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @ClassName WebConfig
 * @Description TODO
 * @Author shurlyn.yang
 * @Date 2018/12/4 12:58
 * @Version 1.0
 **/
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new PermissionHandler()).addPathPatterns("/**");
        //多个拦截器组成一个拦截器链
        super.addInterceptors(registry);
    }
}
